package com.itheima.d2_array;


import java.util.Random;
import java.util.Scanner;

public class Test7 {
    public static void main(String[] args) {
        int[] a = new int[5];
        Random r = new Random();
        for (int i = 0; i < a.length; i++) {
            a[i] = r.nextInt(100) + 1;
            System.out.println(a[i]);
        }
        System.out.println("------------");
        int max = a[0];
        for (int z = 1; z < a.length; z++) {
            if (a[z] > max) {
                max = a[z];
            }
        }
        System.out.println("最大值：" + max);
    }
}
